from selenium import webdriver
import time
import pickle
import os

browser = webdriver.Chrome()
browser.implicitly_wait(30)
def saveCookie():
    cookieDict=browser.get_cookies()
    cookieFile=open(os.path.dirname(__file__)+"/cookie.log","wb")
    print(cookieDict)
    cookieFile.write(pickle.dumps(cookieDict))
    cookieFile.close()

browser.get('http://xf.faxuan.net')
while True:   
    saveCookie()
    time.sleep(3)